All Questions
2 questions
1vote
1answer
126views
Should "magic" getter functions be used for dynamically calculated values or just existing properties?
For example, if I had a Customer class and wanted to get all orders by them. Would it be better to do: class Customer{ public function getOrders(){ return results from db query } } .....
5votes
8answers
2kviews
Rule of thumb for deciding which class a method belongs to
For example, imagine a website which stores results about a certain sport or game, which has a typical "season" structure, such that there's both a Player and a Season class. To retrieve a player's ...